<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" layout:decorator="layout/base">
<head>
	<title>角色管理</title>
	<script type="text/javascript" th:src="@{/assets/js/core/libraries/jquery_ui/core.min.js}"></script>
	<script type="text/javascript" th:src="@{/assets/js/core/libraries/jquery_ui/effects.min.js}"></script>
	<script type="text/javascript" th:src="@{/assets/js/plugins/trees/fancytree_all.min.js}"></script>
</head>

<body>

	<!-- Page header -->
	<div class="page-header" layout:fragment="page-header">
		<div class="page-header-content">
			<div class="page-title">
				<h4><i class="icon-arrow-left52 position-left"></i> <span class="text-semibold" th:text="#{web.name}">管理系统</span> - 角色管理</h4>
			</div>
		</div>
	</div>
	<!-- /page header -->


	<!-- Main content -->
	<div class="content-wrapper" layout:fragment="content">

		<!-- Table -->
		<div class="panel panel-flat min-panel">
			<div class="panel-heading">
				<h5 class="panel-title text-primary"><i class="icon-user-tie" />角色列表</h5>
        	</div>

        	<div class="panel-body">
       			<form id="query" action="#" class="form-horizontal">
					<div class="row">
						<div class="col-md-8">
							<div class="form-group">
								<label class="col-lg-2 control-label">角色名:</label>
								<div class="col-lg-10">
									<input type="text" name="name" class="form-control" placeholder="角色名 模糊查询" />
								</div>
							</div>
						</div>

						<div class="col-md-4 ">
							<div class="form-group">
								<button type="button" id="submit" class="btn btn-primary">查询 <i class="icon-search position-right"></i></button>
								<button type="button" class="btn btn-primary btn-add" data-toggle="modal" data-target="#edit_dialog">新增<i class="icon-plus position-right"></i></button>
							</div>
						</div>
					</div>
       			</form>
				<table class="table datatable-basic table-striped table-hover">
					<thead>
						<tr class="bg-primary">
							<th>角色名</th>
							<th>描述</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody class="border-dashed">
						
					</tbody>
				</table>
			</div>
			<div id="edit_dialog" class="modal fade in">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal">×</button>
							<h5 class="modal-title text-primary">编辑角色</h5>
						</div>

						<form action="#" id="edit">
							<div class="modal-body">
								<div class="form-group">
									<div class="row">
										<div class="col-sm-12">
											<label>角色名<span class="text-danger">*</span></label>
											<input name="id" type="text" style="display:none"/>
											<input name="name" type="text" placeholder="角色名" class="form-control" required="true" maxlength="30"/>
										</div>
									</div>
								</div>
								
								<div class="form-group">
									<div class="row">
										<div class="col-sm-12">
											<label>描述</label>	
											<textarea rows="5" cols="5" name="description" class="form-control" placeholder="输入角色描述..." maxlength="100"></textarea>
										</div>
									</div>
								</div>
							</div>
								
							<div class="modal-footer">
								<button type="button" class="btn btn-link" data-dismiss="modal">关闭</button>
								<button type="button" id="submitEdit" class="btn btn-primary" >保存</button>
							</div>
						</form>
					</div>
				</div>
			</div>
			<div id="perm_dialog" class="modal fade in">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal">×</button>
							<h5 class="modal-title text-primary">权限设置</h5>
						</div>

						<form action="#" id="edit">
							<div class="modal-body">
								<div class="tree-default well border-left-primary border-left-lg">
									<extend:permissions />
								</div>
							</div>
								
							<div class="modal-footer">
								<button type="button" class="btn btn-link" data-dismiss="modal">关闭</button>
								<button type="button" id="submitPerm" class="btn btn-primary" >保存</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<script type="text/templete" id="btnGroup">
			<div class="btn-group" data-toggle="buttons">
				<button type="button" class="btn bg-slate btn-icon  btn-perm" data-toggle="modal" data-target="#perm_dialog"><i class="icon-key"></i></button>
            	<button type="button" class="btn bg-slate btn-icon btn-edit"  data-toggle="modal" data-target="#edit_dialog"><i class="icon-wrench"></i></button>
                <button type="button" class="btn bg-slate btn-icon  btn-del" ><i class="icon-cross"></i></button>
			</div>
		</script>

		<script type="text/templete" id="btnGroupReadOnly">
			<div class="btn-group" data-toggle="buttons">
                <button type="button" class="btn bg-slate btn-icon  btn-perm" data-toggle="modal" data-target="#perm_dialog"><i class="icon-key"></i></button>
			</div>
		</script>
		<!-- /table -->
		<script type="text/javascript" th:src="@{/oss/js/role.js}"></script>

	</div>
	<!-- /main content -->

</body>
</html>
